package cn.bqjr.eily.web.entity;

import cn.bqjr.eily.web.exception.ErrorInfo;

public class BaseResponseVO<T> {
    // 结果编码
    String resultCode;
    // 结果描述
    String resultMsg;
    // 结果信息
    T resultData;
    // 是否存在错误
    boolean hasError = false;
    // 异常信息
    ErrorInfo errors;

    public T getResultData() {
        return resultData;
    }

    public BaseResponseVO setResultData(T resultData) {
        this.resultData = resultData;
        return this;
    }

    public String getResultCode() {
        return resultCode;
    }

    public BaseResponseVO setResultCode(String resultCode) {
        this.resultCode = resultCode;
        return this;
    }

    public String getResultMsg() {
        return resultMsg;
    }

    public BaseResponseVO setResultMsg(String resultMsg) {
        this.resultMsg = resultMsg;
        return this;
    }

    public boolean isHasError() {
        return hasError;
    }

    public BaseResponseVO setHasError(boolean hasError) {
        this.hasError = hasError;
        return this;
    }

    public ErrorInfo getErrors() {
        return errors;
    }

    public BaseResponseVO setErrors(ErrorInfo errors) {
        this.errors = errors;
        return this;
    }

    public BaseResponseVO success() {
        setResultMsg("操作成功！");
        return this;
    }
}
